<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us">
<head>
	<title>UFD @VERSION demonstration index</title>

	<!--  css for demonstrations / examples  -->    
	<link href="../examples/example.css" rel="stylesheet" type="text/css" />

 </head>
 <body>
	<h1>UFD issue test:</h1>
	<a href="http://code.google.com/p/ufd/issues/detail?id=15">http://code.google.com/p/ufd/issues/detail?id=15</a>
	
	<pre>
		I found out ufd is preventing from submitting html form with the Return 
		key (in other plain text input elements) in IE 7 and 8 (don't know about 
		6) when the submit button is an image (input type="image").
		
		E.g.
		&lt;input type="text" .../>
		&lt;ufd>
		&lt;input type="image" src="..." />
		=> won't work with the Return key pressed in the text input, the order of 
		the elements doesn't seem to matter
		
		Digging into the code revealed these two lines in the "disable" method:
		
		this.input.attr("disabled", "disabled");
		this.selectbox.attr("disabled", "disabled");
		
		When these two are commented, submitting with the Return key works fine. I 
		see the fields are enabled at the and of the method but can't really say 
		how it affects the method and why they have to be disabled. Also I cannot 
		explain why it is an issue for IE, especially when the fields are enabled 
		again. There is no problem with other browsers.	
	</pre>

	<p>
		Toolman: 
		
		This seems to happen in in iE6-8 if any regular input (text, checkbox etc) gets its disabled attribute touched, 
		and the form has an input type="img". It seems to need the type="image"; an image type="submit" doesnt exhibit the same bug.
		
		You need at least 2+1 inputs (2 regular + 1 type="image"), it doesnt seem to happen with only 1+1.     
		
		This example is minimalised down to raw JS with no included scripts.  Try enter to confirm that it submits,
		then "break" IE and try again.  
	</p>

	<span onclick="breakIE();" style="border: 1px solid black; padding 5px;">Click to break enter-to-submit on form</span>
	
	<form>
		<input type="text" id="first"/>
		<input type="text"/>
		<input type="image" id="image" src="../css/plain/icon.gif" title="This is an image submit button"/>
	
		<script type="text/javascript" >
			var breakIE = function(){
				var first = document.getElementById("first");
				
				first.setAttribute("disabled", true);
				first.removeAttribute("disabled");

				//same problem
				
				//first.setAttribute("disabled", true);
				//first.setAttribute("disabled", false); 
				
				//first.disabled = true;
				//first.disabled = false;
				alert("broken!");

			};
		</script>
	
	</form>
  </body>
</html> 
